package com.tsk.example.runner;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author: 黄嘉振
 * @create: 2023/1/17 10:54
 * @description: 执行自定义的run，需要交给spring管理，否则无法扫描
 **/
@Component
public class MyRunner implements ApplicationRunner, CommandLineRunner {
    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("--------ApplicationRunner---------run--------");
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("-------------CommandLineRunner------run---------");
    }
}
